using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ImportCarTaxCalculation
{
    public partial class CarTaxCalculatorForm : Form
    {
        public CarTaxCalculatorForm()
        {
            InitializeComponent();

        }
        
        int generalDetection;
        int carAmount;
        int actualFinnishPrice;
        int taxableValue;
        int VAT;
        int carTax;
        int totalAmountPayable;
        int total;
        private void TaxCalculation()
        {
            carAmount = (int)actualCarPrice.Value;
            actualFinnishPrice = (int)finnishPrice.Value;
            int temp = (int)( actualFinnishPrice * .05);
            generalDetection =(int)(temp + 750.00);
            taxableValue = actualFinnishPrice - generalDetection;
            carTax =(int) (taxableValue * .29);
            VAT = (int)(carTax * .22);
            totalAmountPayable = carTax + VAT;
            textBoxTax.Text = totalAmountPayable.ToString();
            total = carAmount + totalAmountPayable;
            textBoxTotalAmount.Text = total.ToString();
            int profit = actualFinnishPrice - total;
            textBoxProfit.Text = profit.ToString();
        }

        private void btnCalculate_Click(object sender, EventArgs e)
        {
            TaxCalculation();

        }

        private void btnReset_Click(object sender, EventArgs e)
        {
            actualCarPrice.Value = 0;
            finnishPrice.Value = 0;
            textBoxTax.Clear();
            textBoxTotalAmount.Clear();
        }
    }
}